<!--
 * @Description: 
 * @FilePath: \rs_wms_pc\src\views\components\tableSelectDialog\index.vue
-->
<template>
    <el-dialog :title="title" :visible.sync="open" width="70vw" append-to-body>
        <slot></slot>

        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submit">确 定</el-button>
            <el-button @click="cancel">取 消</el-button>
        </div>
    </el-dialog>
</template>

<script>
export default {
  name: "TableSelectDialog",
  props:{
      title:{
          type: String,
          default:'请选择'
      }
  },
  data(){
      return{
          loading:false,
          open:false,
          tableList:[]
      }
  },
  methods:{
    init(){
      this.reset();
      this.open = true;
      this.$refs.table.bootstrapTable(tableOption)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    submit(){
        this.$emit("callBack")
        this.cancel()
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.queryParams = {
        name: null,
      };
      this.resetForm("queryForm");
    },
  }

}
</script>